using UnityEngine;
using System.Collections;

public class escapeMenu : MonoBehaviour {

    bool displayMenu = false;
  
	// Use this for initialization
	void Start () 
    {

	}
	
	// Update is called once per frame
	void Update () 
    {
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            displayMenu = !displayMenu;
        }

	}
    void OnGUI()
    {
        if (displayMenu)
        {
            
            GUI.Box(new Rect(500, 150, 300, 150), "");
            if (GUI.Button(new Rect(520, 170, 250, 50), "Main Menu"))
            {
                Application.LoadLevel(1);
            }
            
        }
    }
    
}
